package com.sihai.ehr.web.action.ajax;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

import com.sihai.core.Limit;
import com.sihai.core.LimitedList;
import com.sihai.core.beans.BeanInject;
import com.sihai.ehr.model.biz.AuditType;
import com.sihai.ehr.model.biz.Auditing;
import com.sihai.ehr.model.biz.EmployeeinfoWork;
import com.sihai.ehr.model.biz.ExamAward;
import com.sihai.ehr.model.biz.ExamAwardItem;
import com.sihai.ehr.model.biz.ExamBaseConfig;
import com.sihai.ehr.model.biz.ExamPeriod;
import com.sihai.ehr.model.biz.ExamQualDistSet;
import com.sihai.ehr.model.biz.ExamQualScore;
import com.sihai.ehr.model.biz.ExamStatistics;
import com.sihai.ehr.model.sys.ExamShowYearlyEnum;
import com.sihai.ehr.model.sys.ExaminePeriodEnum;
import com.sihai.ehr.model.sys.Organization;
import com.sihai.ehr.service.AuditService;
import com.sihai.ehr.service.EmployeeService;
import com.sihai.ehr.service.ExamAppManageService;
import com.sihai.ehr.service.ExamAwardItemService;
import com.sihai.ehr.service.ExamBaseConfigService;
import com.sihai.ehr.service.ExamPeriodService;
import com.sihai.ehr.service.ExamQualScoreService;
import com.sihai.ehr.service.ExamQualSetService;
import com.sihai.ehr.service.OrganizationService;
import com.sihai.ehr.web.action.EHRAction;

/**
 * 考核JSON控制器
 * 
 * @author henry
 * 
 */
public class ExamJsonAction extends EHRAction {

	private static DecimalFormat decimalFormat = new DecimalFormat("#.#");
	@BeanInject
	ExamPeriodService examPeriodService;
	@BeanInject
	ExamQualScoreService examQualScoreService;
	@BeanInject
	ExamAppManageService examAppManageService;
	@BeanInject
	private ExamQualSetService examQualSetService;
	@BeanInject
	private OrganizationService organizationService;
	@BeanInject
	private ExamBaseConfigService examBaseConfigService;
	@BeanInject
	private EmployeeService employeeService;
	@BeanInject
	private AuditService auditService;
	@BeanInject
	private ExamAwardItemService examAwardItemService;

	/** 考核周期类型 */
	ExaminePeriodEnum periodEnum;

	List<ExamPeriod> periods;

	List<ExamAwardItem> awardItems;

	int awardType;

	/** 当前考核周期编号 */
	Long periodId;
	/** 人员任职编号 */
	Long workId;
	/** 显示线性分数类型 1：本年度,2：上年度,3：全部 */
	ExamShowYearlyEnum showYearlyEnum;

	String[] monthlyKey = { "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
			"九月", "十月", "十一月", "十二月" };
	Float[] monthlyVal = { 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };

	String[] bimonthlyKey = { "一~二月", "三~四月", "五~六月", "七~八月", "九~十月", "十一~十二月" };
	Float[] bimonthlyVal = { 0f, 0f, 0f, 0f, 0f, 0f };

	String[] seasonKey = { "第一季度", "第二季度", "第三季度", "第四季度" };
	Float[] seasonVal = { 0f, 0f, 0f, 0f };

	String[] halfyearKey = { "1~6月", "7~12月" };
	Float[] halfyearVal = { 0f, 0f };
	List<String> strKey = new ArrayList<String>();
	List<Float> floatVal = new ArrayList<Float>();

	/** 定性考核分数线 */
	private QualScoreLine qualScoreLine;

	/**
	 * 定性线性打分数轴
	 * 
	 * @author henry
	 * 
	 */
	class QualScoreLine {
		private String[] title;
		private Float[] value;

		public QualScoreLine() {
		}

		public QualScoreLine(String[] title, Float[] value) {
			super();
			this.title = title;
			this.value = value;
		}

		public String[] getTitle() {
			return title;
		}

		public void setTitle(String[] title) {
			this.title = title;
		}

		public Float[] getValue() {
			return value;
		}

		public void setValue(Float[] value) {
			this.value = value;
		}
	}

	/**
	 * 检测强制分布考核周期类型
	 * 
	 * @return
	 */
	@Action(value = "/ajax/exam_qual_checkdisttype", results = { @Result(name = "success", type = "plainText") })
	public String checkQualDistType() {
		if (organizationId == null || organizationId <= 0 || periodEnum == null) {
			return ERROR;
		}
		ExamQualDistSet distSet = examQualSetService.getExamQualDistSet(
				organizationId, periodEnum);
		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			if (distSet == null) {
				response.getWriter().write("{\"type\":\"percentage\"}");
			} else {
				response.getWriter().write(
						"{\"type\":\"" + distSet.getType() + "\"}");
			}
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			// e.printStackTrace();
		}
		return SUCCESS;
	}

	// 得到定性考核项目未分配的百分比
	@Action(value = "/ajax/exam_qual_validateinduce", results = { @Result(name = "success", type = "plainText") })
	public String validateInduceCondition() {
		if (organizationId == null || organizationId <= 0 || periodEnum == null) {
			return ERROR;
		}
		// 检测上级组织结构是否已经设置
		boolean checkSeted = false;
		Organization vOrganization = organizationService.get(organizationId)
				.getParent();
		if (vOrganization == null) {
			checkSeted = true;
		} else if (examQualSetService.getExamQualDistSet(vOrganization.getId(),
				periodEnum) != null) {
			checkSeted = true;
		}

		Float d = examQualSetService.getQualCoerceTotalPercentageByOrgId(
				organizationId, periodEnum);
		Float percentage = (d == null ? 0f : d.floatValue());
		percentage = Float.parseFloat(decimalFormat.format(percentage));

		try {
			HttpServletResponse response = ServletActionContext.getResponse();
			response.getWriter().write(
					"{\"checkseted\":" + checkSeted + ",\"percentage\":"
							+ decimalFormat.format(percentage) + "}");
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			// e.printStackTrace();
		}
		return SUCCESS;
	}

	/**
	 * 获取考核周期期数
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "/ajax/period_list", results = { @Result(name = "success", type = "json", params = {
			"root", "periods" }) })
	public String getExamPeriodTOJson() throws Exception {
		try {
			periods = examPeriodService.searchExamPeriods(periodEnum,
					new Limit(0, 3), createSorter().desc("create_date"));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return SUCCESS;
	}

	/**
	 * 获取奖惩项目
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "/ajax/awarditem_list", results = { @Result(name = "success", type = "json", params = {
			"root", "awardItems" }) })
	public String getExamAwardItemTOJson() throws Exception {
		try {
			awardItems = examAwardItemService.searchExamAwardItemList(
					employeeService.getEmployeeinfoWork(workId)
							.getOrganization().getTopOrganization().getId(),
					awardType, null, null);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return SUCCESS;
	}

	/**
	 * 获取定性考核原始线图分数
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "/ajax/qualrawscore_list", results = { @Result(name = "success", type = "plainText") })
	public String getExamRawQualScore() throws Exception {
		try {
			Calendar mCalendar = Calendar.getInstance();
			int year = showYearlyEnum == ExamShowYearlyEnum.present_year ? mCalendar
					.get(Calendar.YEAR)
					: (showYearlyEnum == ExamShowYearlyEnum.last_year ? mCalendar
							.get(Calendar.YEAR) - 1 : -1);
			LimitedList<ExamQualScore> qualScores = examQualScoreService
					.searchEmployeeExamQualScores(workId, periodEnum, year,
							null, null);
			// 修改值

			if (qualScores != null && qualScores.size() > 0) {
				for (ExamQualScore score : qualScores) {
					if (showYearlyEnum == ExamShowYearlyEnum.all) {
						strKey.add(String.valueOf(score.getExamPeriod()
								.getPeriodName()));
						floatVal.add(score.getRawScore());
					} else {
						if (periodEnum == ExaminePeriodEnum.monthly) {
							monthlyVal[score.getExamPeriod().getExamMonthly() - 1] = score
									.getRawScore();
						} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 2 - 1] = score
									.getRawScore();
						} else if (periodEnum == ExaminePeriodEnum.season) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 3 - 1] = score
									.getRawScore();
						} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
							halfyearVal[score.getExamPeriod().getExamMonthly() / 6 - 1] = score
									.getRawScore();
						} else {
							strKey.add(String.valueOf(score.getExamPeriod()
									.getExamYear()));
							floatVal.add(score.getRawScore());
						}
					}
				}
			}

			if (showYearlyEnum == ExamShowYearlyEnum.all) {
				qualScoreLine = new QualScoreLine(
						strKey.toArray(new String[0]),
						floatVal.toArray(new Float[0]));
			} else {
				if (periodEnum == ExaminePeriodEnum.monthly) {
					qualScoreLine = new QualScoreLine(monthlyKey, monthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
					qualScoreLine = new QualScoreLine(bimonthlyKey,
							bimonthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.season) {
					qualScoreLine = new QualScoreLine(seasonKey, seasonVal);
				} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
					qualScoreLine = new QualScoreLine(halfyearKey, halfyearVal);
				} else {
					qualScoreLine = new QualScoreLine(
							strKey.toArray(new String[0]),
							floatVal.toArray(new Float[0]));
				}
			}
			HttpServletResponse response = ServletActionContext.getResponse();
			response.getWriter().write(
					"{\"title\":"
							+ JSONArray.fromObject(qualScoreLine.getTitle())
									.toString()
							+ ",\"value\":"
							+ JSONArray.fromObject(qualScoreLine.getValue())
									.toString() + "}");
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}

	/**
	 * 获取定性调整分数
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "/ajax/qualadjustscore_list", results = { @Result(name = "success", type = "plainText") })
	public String getExamAdjustQualScore() throws Exception {
		try {
			Calendar mCalendar = Calendar.getInstance();
			int year = showYearlyEnum == ExamShowYearlyEnum.present_year ? mCalendar
					.get(Calendar.YEAR)
					: (showYearlyEnum == ExamShowYearlyEnum.last_year ? mCalendar
							.get(Calendar.YEAR) - 1 : -1);
			LimitedList<ExamQualScore> qualScores = examQualScoreService
					.searchEmployeeExamQualScores(workId, periodEnum, year,
							null, null);
			// 修改值

			if (qualScores != null && qualScores.size() > 0) {
				for (ExamQualScore score : qualScores) {
					if (showYearlyEnum == ExamShowYearlyEnum.all) {
						strKey.add(String.valueOf(score.getExamPeriod()
								.getPeriodName()));
						floatVal.add(score.getRawScore());
					} else {
						if (periodEnum == ExaminePeriodEnum.monthly) {
							monthlyVal[score.getExamPeriod().getExamMonthly() - 1] = score
									.getAdjustScore();
						} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 2 - 1] = score
									.getAdjustScore();
						} else if (periodEnum == ExaminePeriodEnum.season) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 3 - 1] = score
									.getAdjustScore();
						} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
							halfyearVal[score.getExamPeriod().getExamMonthly() / 6 - 1] = score
									.getAdjustScore();
						} else {
							strKey.add(String.valueOf(score.getExamPeriod()
									.getExamYear()));
							floatVal.add(score.getAdjustScore());
						}
					}
				}
			}

			if (showYearlyEnum == ExamShowYearlyEnum.all) {
				qualScoreLine = new QualScoreLine(
						strKey.toArray(new String[0]),
						floatVal.toArray(new Float[0]));
			} else {
				if (periodEnum == ExaminePeriodEnum.monthly) {
					qualScoreLine = new QualScoreLine(monthlyKey, monthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
					qualScoreLine = new QualScoreLine(bimonthlyKey,
							bimonthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.season) {
					qualScoreLine = new QualScoreLine(seasonKey, seasonVal);
				} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
					qualScoreLine = new QualScoreLine(halfyearKey, halfyearVal);
				} else {
					qualScoreLine = new QualScoreLine(
							strKey.toArray(new String[0]),
							floatVal.toArray(new Float[0]));
				}
			}
			HttpServletResponse response = ServletActionContext.getResponse();
			response.getWriter().write(
					"{\"title\":"
							+ JSONArray.fromObject(qualScoreLine.getTitle())
									.toString()
							+ ",\"value\":"
							+ JSONArray.fromObject(qualScoreLine.getValue())
									.toString() + "}");
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}

	/**
	 * 获取定性考核最终分数线图
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "/ajax/qualscore_list", results = { @Result(name = "success", type = "plainText") })
	public String getExamQualScore() throws Exception {
		try {
			Calendar mCalendar = Calendar.getInstance();
			int year = showYearlyEnum == ExamShowYearlyEnum.present_year ? mCalendar
					.get(Calendar.YEAR)
					: (showYearlyEnum == ExamShowYearlyEnum.last_year ? mCalendar
							.get(Calendar.YEAR) - 1 : -1);
			LimitedList<ExamQualScore> qualScores = examQualScoreService
					.searchEmployeeExamQualScores(workId, periodEnum, year,
							null, null);
			// 修改值

			if (qualScores != null && qualScores.size() > 0) {
				for (ExamQualScore score : qualScores) {
					if (showYearlyEnum == ExamShowYearlyEnum.all) {
						strKey.add(String.valueOf(score.getExamPeriod()
								.getPeriodName()));
						floatVal.add(score.getAdjustScore() == null
								|| score.getAdjustScore() <= 0 ? score
								.getRawScore() : score.getAdjustScore());
					} else {
						if (periodEnum == ExaminePeriodEnum.monthly) {
							monthlyVal[score.getExamPeriod().getExamMonthly() - 1] = score
									.getAdjustScore() == null
									|| score.getAdjustScore() <= 0 ? score
									.getRawScore() : score.getAdjustScore();
						} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 2 - 1] = score
									.getAdjustScore() == null
									|| score.getAdjustScore() <= 0 ? score
									.getRawScore() : score.getAdjustScore();
						} else if (periodEnum == ExaminePeriodEnum.season) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 3 - 1] = score
									.getAdjustScore() == null
									|| score.getAdjustScore() <= 0 ? score
									.getRawScore() : score.getAdjustScore();
						} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
							halfyearVal[score.getExamPeriod().getExamMonthly() / 6 - 1] = score
									.getAdjustScore() == null
									|| score.getAdjustScore() <= 0 ? score
									.getRawScore() : score.getAdjustScore();
						} else {
							strKey.add(String.valueOf(score.getExamPeriod()
									.getExamYear()));
							floatVal.add(score.getAdjustScore() == null
									|| score.getAdjustScore() <= 0 ? score
									.getRawScore() : score.getAdjustScore());
						}
					}
				}
			}

			if (showYearlyEnum == ExamShowYearlyEnum.all) {
				qualScoreLine = new QualScoreLine(
						strKey.toArray(new String[0]),
						floatVal.toArray(new Float[0]));
			} else {
				if (periodEnum == ExaminePeriodEnum.monthly) {
					qualScoreLine = new QualScoreLine(monthlyKey, monthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
					qualScoreLine = new QualScoreLine(bimonthlyKey,
							bimonthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.season) {
					qualScoreLine = new QualScoreLine(seasonKey, seasonVal);
				} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
					qualScoreLine = new QualScoreLine(halfyearKey, halfyearVal);
				} else {
					qualScoreLine = new QualScoreLine(
							strKey.toArray(new String[0]),
							floatVal.toArray(new Float[0]));
				}
			}
			HttpServletResponse response = ServletActionContext.getResponse();
			response.getWriter().write(
					"{\"title\":"
							+ JSONArray.fromObject(qualScoreLine.getTitle())
									.toString()
							+ ",\"value\":"
							+ JSONArray.fromObject(qualScoreLine.getValue())
									.toString() + "}");
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}

	/**
	 * 获取考核最终分数线图
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "/ajax/statisticsscore_list", results = { @Result(name = "success", type = "plainText") })
	public String getExamStatisticsScore() throws Exception {
		try {
			Calendar mCalendar = Calendar.getInstance();
			int year = showYearlyEnum == ExamShowYearlyEnum.present_year ? mCalendar
					.get(Calendar.YEAR)
					: (showYearlyEnum == ExamShowYearlyEnum.last_year ? mCalendar
							.get(Calendar.YEAR) - 1 : -1);
			LimitedList<ExamStatistics> totalScore = examAppManageService
					.searchEmployeeExamStatisticsScores(workId, periodEnum,
							year, null, null);

			// 修改值
			if (totalScore != null && totalScore.size() > 0) {
				for (ExamStatistics score : totalScore) {
					if (showYearlyEnum == ExamShowYearlyEnum.all) {
						strKey.add(String.valueOf(score.getExamPeriod()
								.getPeriodName()));
						floatVal.add(score.getScore());
					} else {
						if (periodEnum == ExaminePeriodEnum.monthly) {
							monthlyVal[score.getExamPeriod().getExamMonthly() - 1] = score
									.getScore();
						} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 2 - 1] = score
									.getScore();

						} else if (periodEnum == ExaminePeriodEnum.season) {
							bimonthlyVal[score.getExamPeriod().getExamMonthly() / 3 - 1] = score
									.getScore();

						} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
							halfyearVal[score.getExamPeriod().getExamMonthly() / 6 - 1] = score
									.getScore();

						} else {
							strKey.add(String.valueOf(score.getExamPeriod()
									.getExamYear()));
							floatVal.add(score.getScore());
						}
					}
				}
			}

			if (showYearlyEnum == ExamShowYearlyEnum.all) {
				qualScoreLine = new QualScoreLine(
						strKey.toArray(new String[0]),
						floatVal.toArray(new Float[0]));
			} else {
				if (periodEnum == ExaminePeriodEnum.monthly) {
					qualScoreLine = new QualScoreLine(monthlyKey, monthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.bimonthly) {
					qualScoreLine = new QualScoreLine(bimonthlyKey,
							bimonthlyVal);
				} else if (periodEnum == ExaminePeriodEnum.season) {
					qualScoreLine = new QualScoreLine(seasonKey, seasonVal);
				} else if (periodEnum == ExaminePeriodEnum.semiyearly) {
					qualScoreLine = new QualScoreLine(halfyearKey, halfyearVal);
				} else {
					qualScoreLine = new QualScoreLine(
							strKey.toArray(new String[0]),
							floatVal.toArray(new Float[0]));
				}
			}
			HttpServletResponse response = ServletActionContext.getResponse();
			response.getWriter().write(
					"{\"title\":"
							+ JSONArray.fromObject(qualScoreLine.getTitle())
									.toString()
							+ ",\"value\":"
							+ JSONArray.fromObject(qualScoreLine.getValue())
									.toString() + "}");
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}

	@Action(value = "/ajax/check_showscore", results = { @Result(name = "success", type = "plainText") })
	public String checkShowScore() throws Exception {
		boolean showScore = false;
		try {
			// 检测是否允许打分
			EmployeeinfoWork employeeinfoWork = employeeService
					.getEmployeeinfoWork(workId);
			// 读取配置对象信息
			ExamBaseConfig config = examBaseConfigService
					.getExamBaseConfigByDutyId(employeeinfoWork.getDuty()
							.getId());
			List<Auditing> auditings = auditService.findAudits(employeeinfoWork
					.getOrganization().getTopOrganization().getId(),
					AuditType.audit_exam_qual_target, config.getId());
			if (auditings != null && auditings.size() > 0
					&& getCurrentUser() != null
					&& getCurrentUser().getId() != null
					&& getCurrentUser().getId() > 0) {
				Iterator<Auditing> it = auditings.iterator();
				while (it.hasNext()) {
					Auditing mAuditing = it.next();
					if (mAuditing.getEmployee().getId().longValue() == getCurrentUser()
							.getWork().getBaseId().getId().longValue()) {
						showScore = true;
					}
				}
			}
			HttpServletResponse response = ServletActionContext.getResponse();
			response.getWriter().write(String.valueOf(showScore));
			response.getWriter().flush();
			response.getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}

	public ExaminePeriodEnum getPeriodEnum() {
		return periodEnum;
	}

	public void setPeriodEnum(ExaminePeriodEnum periodEnum) {
		this.periodEnum = periodEnum;
	}

	public List<ExamPeriod> getPeriods() {
		return periods;
	}

	public void setPeriods(List<ExamPeriod> periods) {
		this.periods = periods;
	}

	public void setAwardItems(List<ExamAwardItem> awardItems) {
		this.awardItems = awardItems;
	}

	public List<ExamAwardItem> getAwardItems() {
		return awardItems;
	}

	public void setAwardType(int awardType) {
		this.awardType = awardType;
	}

	public int getAwardType() {
		return awardType;
	}

	public Long getPeriodId() {
		return periodId;
	}

	public void setPeriodId(Long periodId) {
		this.periodId = periodId;
	}

	public Long getWorkId() {
		return workId;
	}

	public void setWorkId(Long workId) {
		this.workId = workId;
	}

	public ExamShowYearlyEnum getShowYearlyEnum() {
		return showYearlyEnum;
	}

	public void setShowYearlyEnum(ExamShowYearlyEnum showYearlyEnum) {
		this.showYearlyEnum = showYearlyEnum;
	}

	public QualScoreLine getQualScoreLine() {
		return qualScoreLine;
	}

	public void setQualScoreLine(QualScoreLine qualScoreLine) {
		this.qualScoreLine = qualScoreLine;
	}
}
